package ch01.a19;

import ch01.a19.abstracts.Operation;
import ch01.a19.Factory.OperationFactory;

/**
 * @description: 客户端调用工厂类实现计算
 * @author: Fesine
 * @createTime:2016/7/13 17:50
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/13 17:50
 */
public class Client {
    public static void main(String[] args) {
        Operation operation = OperationFactory.createOperate('+');//其实是返回了new OperationAdd();
        operation.setNumberA(10);
        operation.setNumberB(10);
        double result = operation.getResult();
        System.out.println(result);
        operation = OperationFactory.createOperate('*');//其实是返回了new OperationMul();;
        operation.setNumberA(10);
        operation.setNumberB(10);
        result = operation.getResult();
        System.out.println(result);
    }
}
